#include <iostream>
using namespace std;

#define ArraySizeOf(x) (sizeof(x)/sizeof(*x))

int array[] = {4563, 4573, 4583, 4653, 4673, 4683, 4753, 4763, 4783,4853, 
4863, 4873, 5463, 5473, 5483, 5643, 5673, 5683, 5743, 5763, 
5783, 5843, 5863, 5873, 6453, 6473, 6483, 6543, 6573, 6583, 
6743, 6753, 6783, 6843, 6853, 6873, 7453, 7463, 7483, 7543, 
7563, 7583, 7643, 7653, 7683, 7843, 7853, 7863, 8453, 8463, 
8473, 8543, 8563, 8573, 8643, 8653, 8673, 8743, 8753, 8763, 
3465, 3475, 3485, 3645, 3675, 3685, 3745, 3765, 3785, 3845, 
3865, 3875, 4365, 4375, 4385, 4635, 4675, 4685, 4735, 4765, 
4785, 4835, 4865, 4875, 6345, 6375, 6385, 6435, 6475, 6485, 
6735, 6745, 6785, 6835, 6845, 6875, 7345, 7365, 7385, 7435, 
7465, 7485, 7635, 7645, 7685, 7835, 7845, 7865};

void BubbleSort(int *array, int n)
{
	for (int i = 0; i < n; ++i)
	{
		int m=i;
		for (int j = i; j < n; ++j)
		{
			if(array[j] < array[m])
				m = j;
		}
		int temp = array[m];
		array[m] = array[i];
		array[i] = temp;
	}
}

int main()
{
	BubbleSort(array, ArraySizeOf(array));
	for (int i = 0; i < ArraySizeOf(array); ++i)
	{
		cout << array[i] << "\t" ;
	}
	cout << endl;
	return 0;
}